package hn.sigit.logic.general;

import hn.sigit.model.commons.ISpatialZone;
import hn.sigit.model.hnd.administrative.HND_SpatialRule;
import hn.sigit.model.hnd.cadastre.HND_LandUse;
import hn.sigit.model.hnd.cadastre.HND_Layer;
import hn.sigit.model.ladm.spatialunit.LA_Level;

import java.util.List;

import javax.ejb.Local;

import com.vividsolutions.jts.geom.Geometry;

@Local
public interface GeneralHelper {
	String NAME = "generalHelper";


	String getRequestRootPath();

	String getWorkingSRS();

	String getWorkingNamespace();

	String getRasterLayerName();

	String getPrimaryWMSLayer();

	String getJurisdictionCode();
	
	String getRequestRootMapServer();

	String getOpenLayersPath();

	String getOpenLayersImgPath();

	String getOpenLayersThemeDefaultImgPath();

	String getOpenLayersJS();

	String getWmsCapabilitiesUrl111();

	String getWmsUrl();

	String formatNullText(String text);

	String formatEmptyText(Object value);

	boolean isParcelInstance(ISpatialZone spatialZone);

	String formatZoneNameText(ISpatialZone spatialZone);
	
	String formatLevelText(LA_Level level);

	String formatLandUseText(HND_LandUse landUse);

	String getZoneUsefulName(ISpatialZone spatialZone);
	
	String spatialRuleText(HND_SpatialRule sr);
	
	String spatialRuleDetailsText(HND_SpatialRule sr);
	
	//used to execute EL expression methods denoted by "elMethod" and do action
	String executeELMethod(String elMethod, String action);

	//used to retrieve parcel's WKT to render features in OpenLayers
	//@WebRemote
	String getParcelWKT(long parcelId);

	List<HND_Layer> getLayerList();

	String drawLayerJS(String mapControlName, HND_Layer layer);

	String drawAllLayersJS(String mapControlName);

	double[] calcZoomEnvelope(List<Geometry> envelopeList);
	
	<SZ extends ISpatialZone> double[] calcSZsZoomEnvelope(List<SZ> szList);

	<SZ extends ISpatialZone> List<Geometry> calcEnvelopeFromSZList(List<SZ> szList);

	<SZ extends ISpatialZone> String getSpatialZonesGML(List<SZ> spatialZoneList,
			int neighborLevel);

	ResourceBundleHelper getResBundle();

	void destroy();

	String getDateTimePattern();

	String getTimeZone();

	String escapeJS(String txt);

	String escapeJS2(String txt);

}
